<template>
  <div>
    <!-- <h3>当前最新count：{{ count }}</h3> -->
    <!-- 使用getters第二种方式 -->
    <h3>{{ showNum }}</h3>
    <button @click="sub">-1</button>
    <button @click="subN(3)">-N</button>
    <button @click="subAsync">-1 Async</button>
    <button @click="subNAsync(5)">-N Async</button>
  </div>
</template>
<script>
import { mapState, mapMutations, mapActions, mapGetters } from 'vuex';
export default {
  data() {
    return {
      
    }
  },
  computed: {
    ...mapState(['count']),
    ...mapGetters(['showNum'])
  },
  methods: {
    ...mapMutations(['sub', 'subN']),
    ...mapActions(['subAsync', 'subNAsync']),
    /* subHandle1() {
      this.sub()
    },
    subHandle2() {
      this.subN(3)
    },
    subAsync() {
      this.subAsync()
    }, */
    
  }
}
</script>
<style lang="less" scoped>
  
</style>